﻿#region Using Directives

    using System;

    using Csla;

#endregion

namespace MarketPulse.BusinessLogic.Common.Criteria
{
    /// <summary>
    /// Criteria class specifying the criteria allowable for a search for a Component object
    /// </summary>
    [Serializable]
    public class ComponentCriteria : CriteriaBase<ComponentCriteria>
    {

        #region Constructors

            /// <summary>
            /// Default constructor for this class
            /// </summary>
            /// <param name="componentGuid">The Guid of the Component to associate with this criteria</param>                     
            public ComponentCriteria(Guid componentGuid)
            {
                ComponentGUID = componentGuid;
            }

            /// <summary>
            /// Overlaoded constructor for this class that accepts extra parameters 
            /// </summary>              
            /// <param name="componentGuid">The Guid of the Component to associate with this criteria</param>    
            /// /// <param name="programGuid">The Guid of the Program to associate with this criteria</param>  
            public ComponentCriteria(Guid? componentGuid, Guid? programGuid)
            {                
                ComponentGUID = componentGuid.Value;
                ProgramGUID = programGuid.Value;
            }

        #endregion

        #region Properties

            /// <summary>
            /// This Guid used to identify the Component object as part of this criteria
            /// </summary>
            public static PropertyInfo<Guid> ComponentGUIDProperty = RegisterProperty<Guid>(p => p.ComponentGUID);
            /// <summary>
            /// This Guid used to identify the Component object as part of this criteria
            /// </summary>
            public Guid ComponentGUID
            {
                get { return ReadProperty(ComponentGUIDProperty); }
                private set { LoadProperty(ComponentGUIDProperty, value); }
            }

            /// <summary>
            /// The Guid of the Program to find associated Round objects for
            /// </summary>
            public static PropertyInfo<Guid> ProgramGUIDProperty = RegisterProperty<Guid>(p => p.ProgramGUID);
            /// <summary>
            /// The Guid of the Program to find associated Round objects for
            /// </summary>
            public Guid ProgramGUID
            {
                get { return ReadProperty(ProgramGUIDProperty); }
                private set { LoadProperty(ProgramGUIDProperty, value); }
            }

        #endregion

    }
}
